package com.ruoyi.binance.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.binance.mapper.BinanceAutoSingleCellMapper;
import com.ruoyi.binance.domain.BinanceAutoSingleCell;
import com.ruoyi.binance.service.IBinanceAutoSingleCellService;

/**
 * 自动单格Service业务层处理
 * 
 * @author zq
 * @date 2025-09-10
 */
@Service
public class BinanceAutoSingleCellServiceImpl implements IBinanceAutoSingleCellService 
{
    @Autowired
    private BinanceAutoSingleCellMapper binanceAutoSingleCellMapper;

    /**
     * 查询自动单格
     * 
     * @param code 自动单格主键
     * @return 自动单格
     */
    @Override
    public BinanceAutoSingleCell selectBinanceAutoSingleCellByCode(String code)
    {
        return binanceAutoSingleCellMapper.selectBinanceAutoSingleCellByCode(code);
    }

    /**
     * 查询自动单格列表
     * 
     * @param binanceAutoSingleCell 自动单格
     * @return 自动单格
     */
    @Override
    public List<BinanceAutoSingleCell> selectBinanceAutoSingleCellList(BinanceAutoSingleCell binanceAutoSingleCell)
    {
        return binanceAutoSingleCellMapper.selectBinanceAutoSingleCellList(binanceAutoSingleCell);
    }

    /**
     * 新增自动单格
     * 
     * @param binanceAutoSingleCell 自动单格
     * @return 结果
     */
    @Override
    public int insertBinanceAutoSingleCell(BinanceAutoSingleCell binanceAutoSingleCell)
    {
        binanceAutoSingleCell.setCreateTime(DateUtils.getNowDate());
        return binanceAutoSingleCellMapper.insertBinanceAutoSingleCell(binanceAutoSingleCell);
    }

    /**
     * 修改自动单格
     * 
     * @param binanceAutoSingleCell 自动单格
     * @return 结果
     */
    @Override
    public int updateBinanceAutoSingleCell(BinanceAutoSingleCell binanceAutoSingleCell)
    {
        binanceAutoSingleCell.setUpdateTime(DateUtils.getNowDate());
        return binanceAutoSingleCellMapper.updateBinanceAutoSingleCell(binanceAutoSingleCell);
    }

    /**
     * 批量删除自动单格
     * 
     * @param codes 需要删除的自动单格主键
     * @return 结果
     */
    @Override
    public int deleteBinanceAutoSingleCellByCodes(String[] codes)
    {
        return binanceAutoSingleCellMapper.deleteBinanceAutoSingleCellByCodes(codes);
    }

    /**
     * 删除自动单格信息
     * 
     * @param code 自动单格主键
     * @return 结果
     */
    @Override
    public int deleteBinanceAutoSingleCellByCode(String code)
    {
        return binanceAutoSingleCellMapper.deleteBinanceAutoSingleCellByCode(code);
    }
}
